package day0224;

import java.util.Arrays;

public class Test4 {
    //main方法/main函数
    public static void main(String[] args) throws InterruptedException {
        Test4.createEle();
    }




    private static void createEle() throws InterruptedException {
        int[]  a=new int[0];//1.
        while(true){
            //1.扩容
            a=Arrays.copyOf(a, a.length+1);  {   }
            a[a.length-1]=  (int)(Math.random()*100);//3
            Thread.sleep(1000);
            System.out.println(Arrays.toString(a));
        }

    }





}
